package com.beerandjesus.sportofkings.handicapper.strategy.brisnet.singlefile;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.beerandjesus.sportofkings.handicapper.model.RaceType;
import com.beerandjesus.sportofkings.handicapper.model.KeyTrainerStatistics;

public class KeyTrainerStatisticsResolver {
	
	private static final Map<String, String> STAT_MAP = new HashMap<String, String>();
	
	static {
		STAT_MAP.put(RaceType.S.toString() + "0", "1st time str");
		STAT_MAP.put(RaceType.S.toString() + "1", "2nd career race");
	}

	public KeyTrainerStatistics getKeyTrainerStatistics(
			List<KeyTrainerStatistics> statList, RaceType type, int numStarts) {
		String category = STAT_MAP.get(RaceType.S.toString() + numStarts);
		for (KeyTrainerStatistics stats : statList) {
			if (stats.getCategory() != null && stats.getCategory().trim().equalsIgnoreCase(category)) {
				return stats;
			}
		}
		return null;
	}

}
